package model

import (
	"zsc-boot/app/system_layer/model"
	"zsc-boot/core/orm"
)

type CustomerFlowLog struct {
	orm.Model
	CustomerId  uint                    `json:"customerId" gorm:"column:customer_id;index:inx_customer_id"`
	NewUserId   uint                    `json:"newUserId" gorm:"column:new_user_id;default:0;"`
	OldUserInfo model.ServiceUserSimple `json:"oldUserInfo" gorm:"foreignKey:OldUserId"`
	NewUserInfo model.ServiceUserSimple `json:"newUserInfo" gorm:"foreignKey:NewUserId"`
	OldUserId   uint                    `json:"oldUserId" gorm:"column:old_user_id;default:0;"`
	UserId      uint                    `json:"userId" gorm:"column:user_id;default:0;"`
	UserInfo    model.ServiceUserSimple `json:"userInfo" gorm:"foreignKey:UserId"`
	Reason      string                  `gorm:"column:reason;comment:流转原因;size:128"`
}

func (CustomerFlowLog) TableName() string {
	return "customer_flow_log"
}

func (CustomerFlowLog) TableComment() string {
	return "客户流转记录"
}
